#!/bin/bash
#
# tomcat This shell script takes care of starting and stopping the JON server for JBOSS.
# description: Tomcat Server
#
# process name: startup.sh
# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0
prog="Tomcat"

start() {
     # Start daemons.
     echo -n $"Starting $prog: "
     # Add Your location of Tomcat here
     su - root -c "/usr/1tmc/bin/startup.sh &" >/usr/1tmc/logs/catalina.out 2>&1
     if [ $? -eq 0 ]; then
     success
         else
      failure
    fi
     echo

       RETVAL=$?
}

stop() {
     # Stop daemons.
     echo -n $"Shutting down $prog: "
     # Add Your location of Tomcat here
     su - root -c "/usr/1tmc/bin/shutdown.sh &" >/usr/1tmc/logs/catalina.out 2>&1

       if [ $? -eq 0 ]; then
        success
    else
       failure
   fi
       echo

RETVAL=$?
}

restart() {
     stop
     start
}

# See how we were called.
case "$1" in
     start)
        start
      ;;
     stop)
        stop
     ;;
     restart)
   restart
   ;;
 *)

echo $"Usage: $0 {start|stop| restart}"
exit 1
esac
exit $RETVAL
